package cn.kongwg.juc;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * @author kongwg
 * @create 2021-05-02 11:28
 */
public class BlockQueueDemo {
    public static void main(String[] args) throws InterruptedException {
        BlockingQueue blockingQueue = new ArrayBlockingQueue(3);
//        blockingQueue.add("a");
//        blockingQueue.add("b");
//        blockingQueue.add("c");
//        blockingQueue.add("c");
//
//        blockingQueue.remove();
//        blockingQueue.remove();
//        blockingQueue.remove();
//        blockingQueue.offer("a");
//        blockingQueue.offer("a");
//        blockingQueue.offer("a");
//        blockingQueue.offer("a");
//
//        blockingQueue.poll();
//        blockingQueue.poll();
//        blockingQueue.poll();
//        blockingQueue.poll();

        blockingQueue.put("a");
        blockingQueue.put("a");
        blockingQueue.put("a");
        blockingQueue.put("a");
    }
}
